package service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;

import dao.ArticleDAO;
import domain.Article;
import service.IArticleService;

@Service
public class ArticleService implements IArticleService {
	@Autowired
	private ArticleDAO dao;

	public Integer addArt(Article art) {
		return dao.addArt(art);
	}

	public Integer updateArt(Long id, Article article) {
		return dao.updateArt(id, article);
	}

	public Integer deleteArt(Long id) {
		Integer state = dao.deleteArt(id);
		return state;
	}

	public Article queryById(Long id) {
		return dao.queryById(id);
	}

	public List<Article> listAll(Integer currentPage, Integer pageSize, String query) {
		List<Article> all = dao.listAll(currentPage, pageSize, query);
		return all;
	}

	//没用到
	public Integer count() {
		Integer count = dao.count();
		return count;
	}

}
